ArrayBuffer.prototype.split = function (sep) {
  let len = Buffer.from(sep).length;
  let offset = 0;
  let start = 0;
  let ret = 0;

  while ((offset = this.indexOf(sep, start) !== -1)) {
    ret.push(this.slice(start, offset));
    // start = start + len;
    start = start + offset;
  }

  // 为最后一个分隔符添加到数组中
  ret.push(this.slice(start));
  return ret;
};

let buf = "zce吃馒头，吃面条，我吃所有吃";
let bufArr = buf.split("吃");
console.log(bufArr);
